Purpose:

To determine the DGE profiles (for mouse genes), relative to uninfected controls, of self-assembling co-cultures of primary human hepatocytes (SACC-PHHs) (co-cultured with 3T3J mouse non-parenchymal cells) mono-infected with HBV or co-infected with HBV/HDV at 8 and 28 days post-infection.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(stringr)
library(ggplot2)
library(reshape2)
library(openxlsx)
library(DESeq2)
## Loading required package: S4Vectors
## Loading required package: stats4
## Loading required package: BiocGenerics
## Loading required package: parallel
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
## 
##     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
##     clusterExport, clusterMap, parApply, parCapply, parLapply,
##     parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, cbind, colnames,
##     do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, lengths, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff,
##     sort, table, tapply, union, unique, unsplit
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following objects are masked from 'package:base':
## 
##     colMeans, colSums, expand.grid, rowMeans, rowSums
## Loading required package: IRanges
## 
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## Loading required package: GenomicRanges
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
library(gplots)
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:IRanges':
## 
##     space
## The following object is masked from 'package:S4Vectors':
## 
##     space
## The following object is masked from 'package:stats':
## 
##     lowess
library(dplyr)
library(RColorBrewer)
library(stringr)
library(genefilter)
library(data.table)
## 
## Attaching package: 'data.table'
## The following object is masked from 'package:SummarizedExperiment':
## 
##     shift
## The following object is masked from 'package:GenomicRanges':
## 
##     shift
## The following object is masked from 'package:IRanges':
## 
##     shift
## The following objects are masked from 'package:S4Vectors':
## 
##     first, second
## The following objects are masked from 'package:reshape2':
## 
##     dcast, melt
## The following objects are masked from 'package:dplyr':
## 
##     between, first, last
library(genefilter)
library(ggrepel)
library(viridis)
## Loading required package: viridisLite
source("http://bioconductor.org/biocLite.R")
## Bioconductor version 3.3 (BiocInstaller 1.22.3), ?biocLite for help
## A newer version of Bioconductor is available for this version of R,
##   ?BiocUpgrade for help
biocLite("org.Mm.eg.db", suppressUpdates = TRUE)
## BioC_mirror: https://bioconductor.org
## Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.3 (2017-03-06).
## Installing package(s) 'org.Mm.eg.db'
## installing the source package 'org.Mm.eg.db'
require(org.Mm.eg.db)
## Loading required package: org.Mm.eg.db
## Loading required package: AnnotationDbi
## 
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:dplyr':
## 
##     select
## 

Function to perform DGE analysis with both donor and treatment set as factors influencing the counts. Since we already sorted out counts into folders containing the ENSEMBL IDs for mouse genes under different infection conditions, we will pull the files from these folders to perform the DGE analysis.

DGE_analysis <- function(sampledirectory) {
a <- basename(Sys.glob(file.path(sampledirectory, "*.txt")))
sample_names <- sub('.txt', '', a)
##Here the donors are renamed based off the Hurel names (i.e. HU___) - RNASeq reads were all named 
##using a different ID system.
sampleTable <- data.frame(sampleName = sample_names, sampleFile = a, treatment = 
    ifelse(grepl("Ctrl", a), "mock", ifelse(grepl("*co|*HDV", a), "coinf", "HBV")), donor = 
      ifelse(grepl("BD330*", a), "HU1019", ifelse(grepl("BD405*", a), "HU1020", 
        ifelse(grepl("HU1016*", a), "HU1016", "HU1007"))), time = ifelse(grepl("*D8", a), "d8", 
      "d28"), replicate =  ifelse(grepl("*sample_1|*D8_am|*D8_aa", a), "a", 
                                    ifelse(grepl("*sample_2|D28_bm|D28_ba", a), "b", 
                                           ifelse(grepl("*sample_3", a), "c", ""))))
dds <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable, directory = sampledirectory, design = 
                                    ~donor + treatment)
dds
dds@colData
contrast <- c("treatment", levels(sampleTable$treatment))
output_basename <- sprintf("%s-%s_vs_%s_%s_analysis", "mousegenes", contrast[2], contrast[3], 
                           levels(sampleTable$time))
output_basename
dds <- estimateSizeFactors(dds)
dds@colData
dds <- estimateDispersions(dds)

plotDispEsts(dds, main=sprintf("%s Dispersion Estimates", output_basename))
dds <- nbinomWaldTest(dds)
res <- results(dds, contrast=contrast)
res <- res[order(res$padj, -abs(res$log2FoldChange)),]
mcols(res, use.names=TRUE)
##Log-intensity ratios = M values, log-intensity averages = A values
##Red points indicate padj < 0.1. 
plotMA(res, alpha=0.1, main=sprintf(output_basename))
attr(res, "filterThreshold")

metadata(res)$alpha
metadata(res)$filterThreshold
plot(metadata(res)$filterNumRej,
     type="b", ylab="number of rejections",
     xlab="quantiles of filter")
lines(metadata(res)$lo.fit, col="red")
abline(v=metadata(res)$filterTheta)

key = "ENSEMBL"
cols = c("ENTREZID", "SYMBOL", "GENENAME", "ALIAS", "REFSEQ", "ACCNUM")
for (col in cols) {
  # Get annotation data for column
  annotation_data <- AnnotationDbi::select(org.Mm.eg.db, rownames(res), col, keytype=key)
  # Collapse one-to-many relationships
  tmp <- aggregate(annotation_data[col], by=annotation_data[key],
                   # to a list
                   FUN=function(x)list(x))
  # Match on key and append to results
  idx <- match(rownames(res), tmp[[key]])
  res[[col]] <- tmp[idx,col]
}

output_data <- as.data.frame(res)
LIST_COLS <- sapply(output_data, is.list)
for (COL in colnames(output_data)[LIST_COLS]) {
  output_data[COL] <-
    sapply(output_data[COL],
           function(x)sapply(x, function(y) paste(unlist(y),
                                                  collapse=", ") ) )
}

# Save data frame above as tab-separated file
write.table(output_data,
            file=file.path("Mouse DGEs_donortreatment", paste(Sys.Date(), "mouse_donor_treatment", 
                    output_basename, "_results.txt", sep='')), quote=FALSE, sep="\t", 
                        row.names=TRUE, col.names=NA)
return(list(dds@colData, head(res)))
}

##For each timepoint, determine the DGE profile when comparing the different treatments groups to one another (i.e. HBV-infected versus control).

##uninfected control cells versus those mono-infected with HBV
DGE_analysis("Mouse d8_ctrlvHBV")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 11 rows and 5 columns
##                            treatment    donor     time replicate
##                             <factor> <factor> <factor>  <factor>
## BD330_Ctrl_D8mousegenes         mock   HU1019       d8          
## BD330_HBV_D8mousegenes           HBV   HU1019       d8          
## BD405A_Ctrl_D8mousegenes        mock   HU1020       d8          
## BD405A_HBV_D8mousegenes          HBV   HU1020       d8          
## Ctrl_D8_sample_1mousegenes      mock   HU1007       d8         a
## Ctrl_D8_sample_2mousegenes      mock   HU1007       d8         b
## Ctrl_D8_sample_3mousegenes      mock   HU1007       d8         c
## HBV_D8_sample_1mousegenes        HBV   HU1007       d8         a
## HBV_D8_sample_2mousegenes        HBV   HU1007       d8         b
## HBV_D8_sample_3mousegenes        HBV   HU1007       d8         c
## HU1016_B_D8mousegenes            HBV   HU1016       d8          
##                            sizeFactor
##                             <numeric>
## BD330_Ctrl_D8mousegenes     1.0346642
## BD330_HBV_D8mousegenes      0.7303584
## BD405A_Ctrl_D8mousegenes    0.7721974
## BD405A_HBV_D8mousegenes     0.7067504
## Ctrl_D8_sample_1mousegenes  1.1787427
## Ctrl_D8_sample_2mousegenes  1.3171032
## Ctrl_D8_sample_3mousegenes  1.1331014
## HBV_D8_sample_1mousegenes   1.4396846
## HBV_D8_sample_2mousegenes   0.9738774
## HBV_D8_sample_3mousegenes   1.3937500
## HU1016_B_D8mousegenes       0.8111123
## 
## [[2]]
## log2 fold change (MAP): treatment HBV vs mock 
## Wald test p-value: treatment HBV vs mock 
## DataFrame with 6 rows and 12 columns
##                     baseMean log2FoldChange      lfcSE      stat
##                    <numeric>      <numeric>  <numeric> <numeric>
## ENSMUSG00000039518  7112.089      0.6768464 0.08554957  7.911745
## ENSMUSG00000035385  1330.663     -0.8361779 0.11319038 -7.387358
## ENSMUSG00000022425  3544.850      0.5343298 0.07548904  7.078244
## ENSMUSG00000022231  1295.233     -0.6244717 0.10742064 -5.813331
## ENSMUSG00000064345 17058.066      0.5268244 0.09128533  5.771184
## ENSMUSG00000023885  3718.135     -0.4011325 0.07877309 -5.092252
##                          pvalue         padj ENTREZID   SYMBOL GENENAME
##                       <numeric>    <numeric>   <list>   <list>   <list>
## ENSMUSG00000039518 2.538060e-15 1.841363e-11 ######## ######## ########
## ENSMUSG00000035385 1.497749e-13 5.433085e-10 ######## ######## ########
## ENSMUSG00000022425 1.459929e-12 3.530595e-09 ######## ######## ########
## ENSMUSG00000022231 6.124180e-09 1.110773e-05 ######## ######## ########
## ENSMUSG00000064345 7.871642e-09 1.142175e-05 ######## ######## ########
## ENSMUSG00000023885 3.538346e-07 4.278450e-04 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000039518 ######## ######## ########
## ENSMUSG00000035385 ######## ######## ########
## ENSMUSG00000022425 ######## ######## ########
## ENSMUSG00000022231 ######## ######## ########
## ENSMUSG00000064345 ######## ######## ########
## ENSMUSG00000023885 ######## ######## ########
DGE_analysis("Mouse d28_ctrlvHBV")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 11 rows and 5 columns
##                             treatment    donor     time replicate
##                              <factor> <factor> <factor>  <factor>
## BD330_Ctrl_D28mousegenes         mock   HU1019      d28          
## BD330_HBV_D28mousegenes           HBV   HU1019      d28          
## BD405A_Ctrl_D28mousegenes        mock   HU1020      d28          
## BD405A_HBV_D28mousegenes          HBV   HU1020      d28          
## Ctrl_D28_sample_1mousegenes      mock   HU1007      d28         a
## Ctrl_D28_sample_2mousegenes      mock   HU1007      d28         b
## Ctrl_D28_sample_3mousegenes      mock   HU1007      d28         c
## HBV_D28_sample_1mousegenes        HBV   HU1007      d28         a
## HBV_D28_sample_2mousegenes        HBV   HU1007      d28         b
## HBV_D28_sample_3mousegenes        HBV   HU1007      d28         c
## HU1016_B_D28mousegenes            HBV   HU1016      d28          
##                             sizeFactor
##                              <numeric>
## BD330_Ctrl_D28mousegenes     1.3557895
## BD330_HBV_D28mousegenes      0.5941100
## BD405A_Ctrl_D28mousegenes    1.1759956
## BD405A_HBV_D28mousegenes     0.9351697
## Ctrl_D28_sample_1mousegenes  0.6763589
## Ctrl_D28_sample_2mousegenes  1.0674628
## Ctrl_D28_sample_3mousegenes  1.1250064
## HBV_D28_sample_1mousegenes   1.1577966
## HBV_D28_sample_2mousegenes   1.3253656
## HBV_D28_sample_3mousegenes   0.8475009
## HU1016_B_D28mousegenes       1.2459546
## 
## [[2]]
## log2 fold change (MAP): treatment HBV vs mock 
## Wald test p-value: treatment HBV vs mock 
## DataFrame with 6 rows and 12 columns
##                      baseMean log2FoldChange      lfcSE      stat
##                     <numeric>      <numeric>  <numeric> <numeric>
## ENSMUSG00000053279   166.3330      0.7402055 0.14947843  4.951922
## ENSMUSG00000054072   383.0008      0.7242820 0.14384818  5.035045
## ENSMUSG00000074934   727.6756     -0.5567154 0.11792382 -4.720975
## ENSMUSG00000020620   536.7238      0.5707276 0.12588856  4.533594
## ENSMUSG00000064341 27372.8604      0.4464180 0.09853559  4.530525
## ENSMUSG00000017002   360.2129     -0.6184647 0.13912869 -4.445271
##                          pvalue        padj ENTREZID   SYMBOL GENENAME
##                       <numeric>   <numeric>   <list>   <list>   <list>
## ENSMUSG00000053279 7.348415e-07 0.003691844 ######## ######## ########
## ENSMUSG00000054072 4.777373e-07 0.003691844 ######## ######## ########
## ENSMUSG00000074934 2.347166e-06 0.007861440 ######## ######## ########
## ENSMUSG00000020620 5.798838e-06 0.011823922 ######## ######## ########
## ENSMUSG00000064341 5.883719e-06 0.011823922 ######## ######## ########
## ENSMUSG00000017002 8.778113e-06 0.014178918 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000053279 ######## ######## ########
## ENSMUSG00000054072 ######## ######## ########
## ENSMUSG00000074934 ######## ######## ########
## ENSMUSG00000020620 ######## ######## ########
## ENSMUSG00000064341 ######## ######## ########
## ENSMUSG00000017002 ######## ######## ########
##uninfected control cells versus those co-infected with HBV and HDV
DGE_analysis("Mouse d8_ctrlvcoinf")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 9 rows and 5 columns
##                              treatment    donor     time replicate
##                               <factor> <factor> <factor>  <factor>
## BD330_Ctrl_D8mousegenes           mock   HU1019       d8          
## BD330_HBV_HDV_D8_amousegenes     coinf   HU1019       d8         a
## BD330_HBV_HDV_D8mousegenes       coinf   HU1019       d8          
## BD405A_Ctrl_D8mousegenes          mock   HU1020       d8          
## BD405A_HBV_HDV_D8mousegenes      coinf   HU1020       d8          
## Ctrl_D8_sample_1mousegenes        mock   HU1007       d8         a
## Ctrl_D8_sample_2mousegenes        mock   HU1007       d8         b
## Ctrl_D8_sample_3mousegenes        mock   HU1007       d8         c
## HU1016_BD_co_D8mousegenes        coinf   HU1016       d8          
##                              sizeFactor
##                               <numeric>
## BD330_Ctrl_D8mousegenes       1.1650841
## BD330_HBV_HDV_D8_amousegenes  0.6866507
## BD330_HBV_HDV_D8mousegenes    0.8160634
## BD405A_Ctrl_D8mousegenes      0.8689167
## BD405A_HBV_HDV_D8mousegenes   0.8081074
## Ctrl_D8_sample_1mousegenes    1.3161638
## Ctrl_D8_sample_2mousegenes    1.4582484
## Ctrl_D8_sample_3mousegenes    1.2641291
## HU1016_BD_co_D8mousegenes     0.9779127
## 
## [[2]]
## log2 fold change (MAP): treatment coinf vs mock 
## Wald test p-value: treatment coinf vs mock 
## DataFrame with 6 rows and 12 columns
##                     baseMean log2FoldChange     lfcSE      stat
##                    <numeric>      <numeric> <numeric> <numeric>
## ENSMUSG00000050578  291.8666      -2.090830 0.2263143 -9.238612
## ENSMUSG00000021822 1086.3773      -1.633466 0.1754663 -9.309283
## ENSMUSG00000038393 8075.1441      -1.147458 0.1306828 -8.780482
## ENSMUSG00000022330  508.6560      -1.470379 0.2015997 -7.293556
## ENSMUSG00000021831 9416.6190      -1.411263 0.1924699 -7.332386
## ENSMUSG00000038264 1197.6153      -1.222209 0.1679321 -7.277998
##                          pvalue         padj ENTREZID   SYMBOL GENENAME
##                       <numeric>    <numeric>   <list>   <list>   <list>
## ENSMUSG00000050578 2.497146e-20 1.629638e-16 ######## ######## ########
## ENSMUSG00000021822 1.286978e-20 1.629638e-16 ######## ######## ########
## ENSMUSG00000038393 1.627758e-18 7.081832e-15 ######## ######## ########
## ENSMUSG00000022330 3.018795e-13 7.370265e-10 ######## ######## ########
## ENSMUSG00000021831 2.260910e-13 7.370265e-10 ######## ######## ########
## ENSMUSG00000038264 3.388109e-13 7.370265e-10 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000050578 ######## ######## ########
## ENSMUSG00000021822 ######## ######## ########
## ENSMUSG00000038393 ######## ######## ########
## ENSMUSG00000022330 ######## ######## ########
## ENSMUSG00000021831 ######## ######## ########
## ENSMUSG00000038264 ######## ######## ########
DGE_analysis("Mouse d28_ctrlvcoinf")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 9 rows and 5 columns
##                               treatment    donor     time replicate
##                                <factor> <factor> <factor>  <factor>
## BD330_Ctrl_D28mousegenes           mock   HU1019      d28          
## BD330_HBV_HDV_D28_bmousegenes     coinf   HU1019      d28         b
## BD330_HBV_HDV_D28mousegenes       coinf   HU1019      d28          
## BD405A_Ctrl_D28mousegenes          mock   HU1020      d28          
## BD405A_HBV_HDV_D28mousegenes      coinf   HU1020      d28          
## Ctrl_D28_sample_1mousegenes        mock   HU1007      d28         a
## Ctrl_D28_sample_2mousegenes        mock   HU1007      d28         b
## Ctrl_D28_sample_3mousegenes        mock   HU1007      d28         c
## HU1016_BD_co_D28mousegenes        coinf   HU1016      d28          
##                               sizeFactor
##                                <numeric>
## BD330_Ctrl_D28mousegenes       1.2702580
## BD330_HBV_HDV_D28_bmousegenes  1.2568780
## BD330_HBV_HDV_D28mousegenes    0.9271231
## BD405A_Ctrl_D28mousegenes      1.1054268
## BD405A_HBV_HDV_D28mousegenes   1.0025912
## Ctrl_D28_sample_1mousegenes    0.6297347
## Ctrl_D28_sample_2mousegenes    0.9904098
## Ctrl_D28_sample_3mousegenes    1.0460913
## HU1016_BD_co_D28mousegenes     1.0468278
## 
## [[2]]
## log2 fold change (MAP): treatment coinf vs mock 
## Wald test p-value: treatment coinf vs mock 
## DataFrame with 6 rows and 12 columns
##                      baseMean log2FoldChange     lfcSE      stat
##                     <numeric>      <numeric> <numeric> <numeric>
## ENSMUSG00000033491   47.36793      1.0222172 0.1902974  5.371684
## ENSMUSG00000027737  450.84204     -1.0359278 0.2010512 -5.152558
## ENSMUSG00000031673 2396.38523     -0.8112513 0.1670639 -4.855933
## ENSMUSG00000081778  160.56608     -0.7149199 0.1582671 -4.517172
## ENSMUSG00000038305   20.47186     -0.6568132 0.1490415 -4.406914
## ENSMUSG00000005686 1255.98589      0.8288639 0.1952677  4.244756
##                          pvalue        padj ENTREZID   SYMBOL GENENAME
##                       <numeric>   <numeric>   <list>   <list>   <list>
## ENSMUSG00000033491 7.800487e-08 0.001085672 ######## ######## ########
## ENSMUSG00000027737 2.569570e-07 0.001788164 ######## ######## ########
## ENSMUSG00000031673 1.198212e-06 0.005558905 ######## ######## ########
## ENSMUSG00000081778 6.267090e-06 0.021806339 ######## ######## ########
## ENSMUSG00000038305 1.048539e-05 0.029187138 ######## ######## ########
## ENSMUSG00000005686 2.188315e-05 0.043509960 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000033491 ######## ######## ########
## ENSMUSG00000027737 ######## ######## ########
## ENSMUSG00000031673 ######## ######## ########
## ENSMUSG00000081778 ######## ######## ########
## ENSMUSG00000038305 ######## ######## ########
## ENSMUSG00000005686 ######## ######## ########
##monoinfected cells (HBV only) versus those co-infected with HBV and HDV
DGE_analysis("Mouse d8_coinfvHBV")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 10 rows and 5 columns
##                              treatment    donor     time replicate
##                               <factor> <factor> <factor>  <factor>
## BD330_HBV_D8mousegenes             HBV   HU1019       d8          
## BD330_HBV_HDV_D8_amousegenes     coinf   HU1019       d8         a
## BD330_HBV_HDV_D8mousegenes       coinf   HU1019       d8          
## BD405A_HBV_D8mousegenes            HBV   HU1020       d8          
## BD405A_HBV_HDV_D8mousegenes      coinf   HU1020       d8          
## HBV_D8_sample_1mousegenes          HBV   HU1007       d8         a
## HBV_D8_sample_2mousegenes          HBV   HU1007       d8         b
## HBV_D8_sample_3mousegenes          HBV   HU1007       d8         c
## HU1016_BD_co_D8mousegenes        coinf   HU1016       d8          
## HU1016_B_D8mousegenes              HBV   HU1016       d8          
##                              sizeFactor
##                               <numeric>
## BD330_HBV_D8mousegenes        0.8562166
## BD330_HBV_HDV_D8_amousegenes  0.7165406
## BD330_HBV_HDV_D8mousegenes    0.8547586
## BD405A_HBV_D8mousegenes       0.8338012
## BD405A_HBV_HDV_D8mousegenes   0.8407318
## HBV_D8_sample_1mousegenes     1.6703247
## HBV_D8_sample_2mousegenes     1.1266403
## HBV_D8_sample_3mousegenes     1.6218624
## HU1016_BD_co_D8mousegenes     1.0226829
## HU1016_B_D8mousegenes         0.9515828
## 
## [[2]]
## log2 fold change (MAP): treatment coinf vs HBV 
## Wald test p-value: treatment coinf vs HBV 
## DataFrame with 6 rows and 12 columns
##                      baseMean log2FoldChange     lfcSE      stat
##                     <numeric>      <numeric> <numeric> <numeric>
## ENSMUSG00000019102  351.78327     -1.0283347 0.1720169 -5.978104
## ENSMUSG00000028760  290.62080     -1.0129153 0.1675173 -6.046630
## ENSMUSG00000034115   27.07254      0.8958305 0.1497669  5.981499
## ENSMUSG00000038393 7600.29094     -0.7174435 0.1270261 -5.648002
## ENSMUSG00000061353 2945.03987     -0.8394278 0.1500969 -5.592571
## ENSMUSG00000027832  572.94359     -0.8943232 0.1658269 -5.393112
##                          pvalue         padj ENTREZID   SYMBOL GENENAME
##                       <numeric>    <numeric>   <list>   <list>   <list>
## ENSMUSG00000019102 2.257500e-09 1.006694e-05 ######## ######## ########
## ENSMUSG00000028760 1.479067e-09 1.006694e-05 ######## ######## ########
## ENSMUSG00000034115 2.210938e-09 1.006694e-05 ######## ######## ########
## ENSMUSG00000038393 1.623230e-08 5.428892e-05 ######## ######## ########
## ENSMUSG00000061353 2.237311e-08 5.986148e-05 ######## ######## ########
## ENSMUSG00000027832 6.924787e-08 1.378168e-04 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000019102 ######## ######## ########
## ENSMUSG00000028760 ######## ######## ########
## ENSMUSG00000034115 ######## ######## ########
## ENSMUSG00000038393 ######## ######## ########
## ENSMUSG00000061353 ######## ######## ########
## ENSMUSG00000027832 ######## ######## ########
DGE_analysis("Mouse d28_coinfvHBV")
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates

## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns

## [[1]]
## DataFrame with 10 rows and 5 columns
##                               treatment    donor     time replicate
##                                <factor> <factor> <factor>  <factor>
## BD330_HBV_D28mousegenes             HBV   HU1019      d28          
## BD330_HBV_HDV_D28_bmousegenes     coinf   HU1019      d28         b
## BD330_HBV_HDV_D28mousegenes       coinf   HU1019      d28          
## BD405A_HBV_D28mousegenes            HBV   HU1020      d28          
## BD405A_HBV_HDV_D28mousegenes      coinf   HU1020      d28          
## HBV_D28_sample_1mousegenes          HBV   HU1007      d28         a
## HBV_D28_sample_2mousegenes          HBV   HU1007      d28         b
## HBV_D28_sample_3mousegenes          HBV   HU1007      d28         c
## HU1016_BD_co_D28mousegenes        coinf   HU1016      d28          
## HU1016_B_D28mousegenes              HBV   HU1016      d28          
##                               sizeFactor
##                                <numeric>
## BD330_HBV_D28mousegenes        0.5817231
## BD330_HBV_HDV_D28_bmousegenes  1.3155398
## BD330_HBV_HDV_D28mousegenes    0.9626580
## BD405A_HBV_D28mousegenes       0.9143691
## BD405A_HBV_HDV_D28mousegenes   1.0495034
## HBV_D28_sample_1mousegenes     1.1233937
## HBV_D28_sample_2mousegenes     1.2779097
## HBV_D28_sample_3mousegenes     0.8260627
## HU1016_BD_co_D28mousegenes     1.0925807
## HU1016_B_D28mousegenes         1.2239818
## 
## [[2]]
## log2 fold change (MAP): treatment coinf vs HBV 
## Wald test p-value: treatment coinf vs HBV 
## DataFrame with 6 rows and 12 columns
##                     baseMean log2FoldChange     lfcSE      stat
##                    <numeric>      <numeric> <numeric> <numeric>
## ENSMUSG00000056427 1093.7615     -1.0388053 0.1693633 -6.133591
## ENSMUSG00000006014   82.5130     -1.1933384 0.2066009 -5.776057
## ENSMUSG00000018830  128.1758     -1.1486217 0.2104613 -5.457638
## ENSMUSG00000050936  183.9195     -1.0065217 0.2035346 -4.945213
## ENSMUSG00000052565  120.4718     -1.0166065 0.2101651 -4.837181
## ENSMUSG00000032690  432.4550     -0.9004502 0.1850722 -4.865399
##                          pvalue         padj ENTREZID   SYMBOL GENENAME
##                       <numeric>    <numeric>   <list>   <list>   <list>
## ENSMUSG00000056427 8.591721e-10 1.241590e-05 ######## ######## ########
## ENSMUSG00000006014 7.647158e-09 5.525454e-05 ######## ######## ########
## ENSMUSG00000018830 4.825113e-08 2.324257e-04 ######## ######## ########
## ENSMUSG00000050936 7.606073e-07 2.747884e-03 ######## ######## ########
## ENSMUSG00000052565 1.316937e-06 3.171844e-03 ######## ######## ########
## ENSMUSG00000032690 1.142263e-06 3.171844e-03 ######## ######## ########
##                       ALIAS   REFSEQ   ACCNUM
##                      <list>   <list>   <list>
## ENSMUSG00000056427 ######## ######## ########
## ENSMUSG00000006014 ######## ######## ########
## ENSMUSG00000018830 ######## ######## ########
## ENSMUSG00000050936 ######## ######## ########
## ENSMUSG00000052565 ######## ######## ########
## ENSMUSG00000032690 ######## ######## ########

Session Info

sessionInfo()
## R version 3.3.3 (2017-03-06)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: macOS Sierra 10.12.6
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] org.Mm.eg.db_3.3.0         AnnotationDbi_1.34.4      
##  [3] BiocInstaller_1.22.3       viridis_0.4.0             
##  [5] viridisLite_0.2.0          ggrepel_0.6.5             
##  [7] data.table_1.10.0          genefilter_1.54.2         
##  [9] RColorBrewer_1.1-2         gplots_3.0.1              
## [11] DESeq2_1.12.4              SummarizedExperiment_1.2.3
## [13] Biobase_2.32.0             GenomicRanges_1.24.3      
## [15] GenomeInfoDb_1.8.7         IRanges_2.6.1             
## [17] S4Vectors_0.10.3           BiocGenerics_0.18.0       
## [19] openxlsx_4.0.17            reshape2_1.4.2            
## [21] ggplot2_2.2.1              stringr_1.2.0             
## [23] dplyr_0.7.3               
## 
## loaded via a namespace (and not attached):
##  [1] splines_3.3.3       gtools_3.5.0        Formula_1.2-1      
##  [4] assertthat_0.2.0    latticeExtra_0.6-28 yaml_2.1.14        
##  [7] RSQLite_1.1-2       backports_1.0.5     lattice_0.20-35    
## [10] glue_1.1.1          digest_0.6.12       XVector_0.12.1     
## [13] checkmate_1.8.2     colorspace_1.3-2    htmltools_0.3.5    
## [16] Matrix_1.2-8        plyr_1.8.4          XML_3.98-1.9       
## [19] pkgconfig_2.0.1     zlibbioc_1.18.0     xtable_1.8-2       
## [22] scales_0.4.1        gdata_2.17.0        BiocParallel_1.6.6 
## [25] htmlTable_1.9       tibble_1.3.3        annotate_1.50.1    
## [28] nnet_7.3-12         lazyeval_0.2.0      survival_2.41-3    
## [31] magrittr_1.5        memoise_1.0.0       evaluate_0.10      
## [34] foreign_0.8-67      tools_3.3.3         munsell_0.4.3      
## [37] locfit_1.5-9.1      cluster_2.0.6       bindrcpp_0.2       
## [40] caTools_1.17.1      rlang_0.1.2         grid_3.3.3         
## [43] RCurl_1.95-4.8      htmlwidgets_0.9     bitops_1.0-6       
## [46] base64enc_0.1-3     rmarkdown_1.4       gtable_0.2.0       
## [49] DBI_0.6-1           R6_2.2.0            gridExtra_2.2.1    
## [52] knitr_1.16          bindr_0.1           Hmisc_4.0-2        
## [55] rprojroot_1.2       KernSmooth_2.23-15  stringi_1.1.5      
## [58] Rcpp_0.12.10        geneplotter_1.50.0  rpart_4.1-10       
## [61] acepack_1.4.1